package Work;

public class Test02 {
    public static void main(String[] args) {
        //4.创建10个成员数组，1 2 4 8 16 32 ...
        int[] arr1 = new int[10];
        int count = 0;
        for(int j = 0; j < arr1.length; j++){
            //用循环给数组赋值
            for(int i = 1; i <= 1000; i*=2){
                count++;
                if(count > 10){
                    break;
                }
                arr1[j] = i;
                System.out.print(arr1[j] + " ");
            }

        }

        System.out.println();
        //5.创建10个成员数组，1 1 2 3 5 8 13 21 34 ...
        int[] arr2 = new int[10];
        int a  = 0;
        count = 0;
        arr2[0] = 1;
        arr2[1] = 1;
        for(int i = 2;i < arr2.length; i++){
            if(++count>10) break;
            arr2[i]= arr2[i-2] + arr2[i-1];
        }
        for (int i: arr2) {
            System.out.print(i + " ");
        }

        //6.创建10个成员的数组，产生10个50~80之间的随机数，放到数组中？
        System.out.println();
        int arr3[] = new int[10];
        for(int i = 0; i < arr3.length; i++ ){
            arr3[i] = (int)(Math.random()*31+50);
            System.out.print(arr3[i] + " ");
        }

    }
}
